package com.gs.xbinfomytest.controller;

import com.gs.xbinfomytest.dto.QueryUserDto;
import com.gs.xbinfomytest.dto.TableDataDto;
import com.gs.xbinfomytest.log.LogRecord;
import com.gs.xbinfomytest.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Created : IntelliJ IDEA.
 * @ProjectName: xbinfomytest
 * @Package: com.gs.xbinfomytest.controller
 * @Author: guoshuai
 * @CreateDate: 2019/8/23 14:13
 * @Description: java类的作用描述
 * @Vsersion: 1.0
 */

@RestController
@RequestMapping("/user")
public class UserManagerController {

    @Resource
    private UserService userService;

    @RequestMapping("/queryUserByPage")
    @ResponseBody
    @LogRecord(value = "根据条件查询用户分页列表")
    public TableDataDto queryUserByPage(Integer offset,Integer limit,String userName){
   // public TableDataDto queryUserByPage(@RequestBody  QueryUserDto queryUserDto){
        QueryUserDto queryUserDto = new QueryUserDto();
        queryUserDto.setPage(offset);
        queryUserDto.setLimit(limit);
        queryUserDto.setUserName(userName);
        System.out.println(queryUserDto.toString());
        TableDataDto tableDataDto1 = userService.queryByPage(queryUserDto);
        return tableDataDto1;
    }



}
